package com.generator.common.enums;

import com.generator.GeneratorApplication;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;

import java.net.URL;

/**
 * 数据库主要配置类
 *
 * @author syl
 * @create 2018-03-23 17:50
 **/
public enum DbType {
    MySQL("com.mysql.jdbc.Driver", "jdbc:mysql://HOST:PORT/DATABASE_NAME?useUnicode=true&serverTimezone=Asia/Shanghai&useSSL=false&characterEncoding=ENCODING", "MySql"),
    Oracle("oracle.jdbc.driver.OracleDriver", "jdbc:oracle:thin:@HOST:PORT:DATABASE_NAME", "Oracle"),
    PostgreSQL("org.postgresql.Driver", "jdbc:postgresql://HOST:PORT/DATABASE_NAME", "PostgreSql"),
    SQL_Server("net.sourceforge.jtds.jdbc.Driver", "jdbc:jtds:sqlserver://HOST:PORT/DATABASE_NAME", "SqlServer"),
//    SqlLite("org.sqlite.JDBC", "jdbc:sqlite:"+ MainUI.getDBURL(), "SqlLite");

    SqlLite("org.sqlite.JDBC", "jdbc:sqlite:db/user_config.db", "SqlLite");

    @Setter
    @Getter
    private String driverClass;
    @Setter
    @Getter
    private String connectionUrlPattern;
    @Setter
    @Getter
    private String daoName;

    DbType(String driverClass, String connectionUrlPattern, String daoName) {
        this.driverClass = driverClass;
        this.connectionUrlPattern = connectionUrlPattern;
        this.daoName = daoName;
    }



}
